package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

@Getter
@Setter
public class NewsType extends BaseDomain {

    private Integer type;

    private String name;

    private boolean state = true;

    public String getJson() {
        HashMap<String, Object> map = new HashMap<> ();
        map.put ("id", id);
        map.put ("type", type);
        map.put ("name", name);
        map.put ("state", state);
        return JSONUtil.toJSONString (map);
    }

    public String getStateName() {
        return true == state ? "启用" : "禁用";
    }

}